import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const Login = () => import("@/views/login/Login")
const Home = () => import("@/views/home/Home")
//region 系统管理子组件
const Welcome = () => import("@/views/systemManager/Welcome")
const Users = () => import("@/views/systemManager/Users")
//endregion

//region 文档
const Swagger = () => import("@/views/doc/Swagger")
const Druid = () => import("@/views/doc/Druid")
const Blog = () => import("@/views/doc/Blog")
const Icons = () => import("@/views/doc/Icons")
//endregion

const Map = () => import("@/views/map/map")

const routes = [
  {
    path: '/',
    redirect: '/login', //重定向到/login
  },
  {
      path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [
      //region 系统管理
      // {
      //   path: '/welcome',
      //   name: 'Welcome',
      //   component: Welcome,
      //   meta:{title: '欢迎页面'},
      // },
      {
          path: '/users',
        component: Users
      },
      //endregion
      //region 其他管理
      {
        path: '/swagger',
        component: Swagger
      },
      {
        path: '/druid',
        component: Druid
      },
      {
        path: '/blog',
        component: Blog
      },
      {
        path: '/icons',
        component: Icons
      },
      //endregion
      //region 健康报备
      {
        path: '/map',
        component: Map
      },
      //endregion

    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
